package main

import "fmt"

/*
练习:定义两个矩阵并求和
练习2：求两个3*3矩阵的和并输出（数据都是int类型）
	解析：矩阵的和计算规则是对应元素相加：
	c[i][j] = a[i][j] + b[i][j]
 */
func main()  {
	arr1 := [3][3]int{{1,2,3},{1,2,3},{8,9,7}}
	arr2 := [3][3]int{{9,7,3},{7,6,3},{1,4,18}}
	var arr3[3][3]int
	for i := range arr1{
		for j := range arr1[0]{
			arr3[i][j] = arr1[i][j]+arr2[i][j]
		}
	}
	fmt.Println(arr3)
}


